/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cc.altius.dao.impl;

import cc.altius.dao.OfficeLocationDao;
import cc.altius.model.OfficeLocation;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author yogesh
 */
@Repository("OfficeLocationDao")
public class OfficeLocationDaoImpl implements OfficeLocationDao {

     private HibernateTemplate hibernateTemplate;
    private SessionFactory sessionFactory;
    Session session;
    Query query;

    @Autowired
    public void setSessionFactory(SessionFactory sessionFactory) {
        this.sessionFactory = sessionFactory;
        this.hibernateTemplate = new HibernateTemplate(sessionFactory);
    }
    
    @Override
    @Transactional
    public List<OfficeLocation> getOfficeLocationsList() {
         List<OfficeLocation> officeList=this.hibernateTemplate.find("from OfficeLocation");
         return officeList;
    }
    
    
}
